package org.HU.train.batch.config;

import jakarta.annotation.Resource;
import org.HU.train.common.interceptor.LogInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author ZUZ
 * @Description: SpringMVC,注册拦截器，打日志用
 * @Date 2024-12-21 20:51
 * @ClassName: SpringMvcConfig
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {

    @Resource
    LogInterceptor logInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(logInterceptor)
                .addPathPatterns("/**");

    }
}
